package xyz.xuminghai.javafx_learn.scene.shape;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.QuadCurve;
import javafx.stage.Stage;

/**
 * 2023/8/12 16:52 星期六<br/>
 * QuadCurve类定义 (x,y) 坐标空间中的二次贝塞尔参数曲线段。
 * 使用指定点 ( (controlX, controlY)作为贝塞尔控制点，绘制一条与指定坐标(startX, startY)和(endX, enfY)相交的曲线。
 *
 * @author xuMingHai
 */
public class QuadCurveApp extends Application {

    private final BorderPane root = new BorderPane();


    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void init() {
        QuadCurve quadCurve = new QuadCurve(0.0, 0.0,
                100.0, 200.0,
                200.0, 0.0);
        quadCurve.setFill(null);
        quadCurve.setStroke(Color.BLACK);
        root.setCenter(quadCurve);
    }

    public void start(Stage primaryStage) {
        primaryStage.setTitle(getClass().getSimpleName());
        Scene scene = new Scene(root, 800, 600);
        primaryStage.setScene(scene);
        primaryStage.show();
    }
}
